using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using ComponentFactory.Krypton.Toolkit;
using DukeyCssFetch.api;

namespace DukeyCssFetch
{
	// Token: 0x0200002F RID: 47
	public class TagsFrmSetting : KryptonForm
	{
		// Token: 0x060001C2 RID: 450 RVA: 0x000143DC File Offset: 0x000125DC
		public TagsFrmSetting()
		{
			
			this.InitializeComponent();
			DirectoryInfo directoryInfo = new DirectoryInfo(Comm.root + "\\tag");
			FileInfo[] files = directoryInfo.GetFiles();
			for (int i = 0; i < files.Length; i++)
			{
				FileInfo fileInfo = files[i];
				if (fileInfo.Extension == ".xml")
				{
					this.combCMS.Items.Add(fileInfo.Name);
				}
			}
			this.combCMS.Text = Comm.CurrentTag;
			this.txtTagWidth.Text = Comm.tagbtnWidth.ToString();
			this.txtTagCols.Text = Comm.tagcols.ToString();
		}

		// Token: 0x060001C3 RID: 451 RVA: 0x0001448C File Offset: 0x0001268C
		private void btnOK_Click(object sender, EventArgs e)
		{
			if (this.combCMS.Text != "")
			{
				Comm.CurrentTag = this.combCMS.Text;
				int tagcols = 6;
				int tagbtnWidth = 90;
				int.TryParse(this.txtTagCols.Text.Trim(), out tagcols);
				int.TryParse(this.txtTagWidth.Text.Trim(), out tagbtnWidth);
				Comm.tagcols = tagcols;
				Comm.tagbtnWidth = tagbtnWidth;
				base.DialogResult = DialogResult.OK;
			}
		}

		// Token: 0x060001C4 RID: 452 RVA: 0x00014508 File Offset: 0x00012708
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.icontainer_0 != null)
			{
				this.icontainer_0.Dispose();
			}
			base.Dispose(disposing);
		}

		// Token: 0x060001C5 RID: 453 RVA: 0x00014528 File Offset: 0x00012728
		private void InitializeComponent()
		{
			this.label1 = new Label();
			this.btnOK = new KryptonButton();
			this.btnCancel = new KryptonButton();
			this.combCMS = new KryptonComboBox();
			this.label2 = new Label();
			this.txtTagCols = new KryptonTextBox();
			this.label3 = new Label();
			this.txtTagWidth = new KryptonTextBox();
			this.label4 = new Label();
			((ISupportInitialize)this.combCMS).BeginInit();
			base.SuspendLayout();
			this.label1.AutoSize = true;
			this.label1.ForeColor = Color.Red;
			this.label1.Location = new Point(10, 52);
			this.label1.Name = "label1";
			this.label1.Size = new Size(227, 12);
			this.label1.TabIndex = 0;
			this.label1.Text = "你可以添加自己的标签到程序的tag目录下";
			this.btnOK.AutoSize = true;
			this.btnOK.Location = new Point(253, 41);
			this.btnOK.Name = "btnOK";
			this.btnOK.Size = new Size(65, 25);
			this.btnOK.TabIndex = 2;
			this.btnOK.Values.Text = "确 定";
			this.btnOK.Click += new EventHandler(this.btnOK_Click);
			this.btnCancel.AutoSize = true;
			this.btnCancel.DialogResult = DialogResult.Cancel;
			this.btnCancel.Location = new Point(339, 41);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new Size(65, 25);
			this.btnCancel.TabIndex = 2;
			this.btnCancel.Values.Text = "关 闭";
			this.combCMS.DropDownStyle = ComboBoxStyle.DropDownList;
			this.combCMS.DropDownWidth = 121;
			this.combCMS.Location = new Point(12, 12);
			this.combCMS.Name = "combCMS";
			this.combCMS.Size = new Size(121, 21);
			this.combCMS.TabIndex = 3;
			this.label2.AutoSize = true;
			this.label2.Location = new Point(164, 18);
			this.label2.Name = "label2";
			this.label2.Size = new Size(29, 12);
			this.label2.TabIndex = 4;
			this.label2.Text = "每行";
			this.txtTagCols.Location = new Point(194, 13);
			this.txtTagCols.Name = "txtTagCols";
			this.txtTagCols.Size = new Size(43, 20);
			this.txtTagCols.TabIndex = 5;
			this.txtTagCols.Text = "6";
			this.label3.AutoSize = true;
			this.label3.Location = new Point(268, 16);
			this.label3.Name = "label3";
			this.label3.Size = new Size(29, 12);
			this.label3.TabIndex = 4;
			this.label3.Text = "宽度";
			this.txtTagWidth.Location = new Point(298, 12);
			this.txtTagWidth.Name = "txtTagWidth";
			this.txtTagWidth.Size = new Size(44, 20);
			this.txtTagWidth.TabIndex = 5;
			this.txtTagWidth.Text = "90";
			this.label4.AutoSize = true;
			this.label4.Location = new Point(240, 18);
			this.label4.Name = "label4";
			this.label4.Size = new Size(17, 12);
			this.label4.TabIndex = 4;
			this.label4.Text = "个";
			base.AcceptButton = this.btnOK;
			base.AutoScaleDimensions = new SizeF(6f, 12f);
			base.AutoScaleMode = AutoScaleMode.Font;
			base.CancelButton = this.btnCancel;
			base.ClientSize = new Size(434, 75);
			base.Controls.Add(this.txtTagWidth);
			base.Controls.Add(this.label3);
			base.Controls.Add(this.txtTagCols);
			base.Controls.Add(this.label4);
			base.Controls.Add(this.label2);
			base.Controls.Add(this.combCMS);
			base.Controls.Add(this.btnCancel);
			base.Controls.Add(this.btnOK);
			base.Controls.Add(this.label1);
			base.FormBorderStyle = FormBorderStyle.FixedToolWindow;
			base.Name = "TagsFrmSetting";
			base.StartPosition = FormStartPosition.CenterParent;
			this.Text = "标签面板设置";
			base.TopMost = true;
			((ISupportInitialize)this.combCMS).EndInit();
			base.ResumeLayout(false);
			base.PerformLayout();
		}

		// Token: 0x040001C0 RID: 448
		private KryptonButton btnCancel;

		// Token: 0x040001BF RID: 447
		private KryptonButton btnOK;

		// Token: 0x040001C1 RID: 449
		private KryptonComboBox combCMS;

		// Token: 0x040001BD RID: 445
		private IContainer icontainer_0;

		// Token: 0x040001BE RID: 446
		private Label label1;

		// Token: 0x040001C2 RID: 450
		private Label label2;

		// Token: 0x040001C4 RID: 452
		private Label label3;

		// Token: 0x040001C6 RID: 454
		private Label label4;

		// Token: 0x040001C3 RID: 451
		private KryptonTextBox txtTagCols;

		// Token: 0x040001C5 RID: 453
		private KryptonTextBox txtTagWidth;
	}
}
